{extend name="pc/admin/layout"/}
{block name="main"}
   <div class="g-1400 g-container" id="pjax-container">
        
<div class="bg-bai b rx3" id="vue-page">
<form id="form-config">
    <div class="t-v t-t">
        <div class="c-sidebar c-sidebar-h pb5 br">
            <div class="c-sidebar-title t-v hui bb">网站基础设置</div>
            <ul class="c-nav click-nav">
                <li><a href="{:url('pc/admin')}" class="t-v" data-pjax>
                    <div><i class="icon icon-form"></i></div>
                    <div>网站信息</div>
                </a></li>
				<li class="active"><a href="{:url('pc/admin',['act'=>'set','s'=>'reg'])}" class="t-v" data-pjax>
                    <div><i class="icon icon-form"></i></div>
                    <div>注册奖励</div>
                </a></li>
				<li><a href="{:url('pc/admin',['act'=>'set','s'=>'mail'])}" class="t-v" data-pjax>
                    <div><i class="icon icon-form"></i></div>
                    <div>邮箱提醒</div>
                </a></li>
				<li><a href="{:url('pc/admin',['act'=>'set','s'=>'chat'])}" class="t-v" data-pjax>
                    <div><i class="icon icon-form"></i></div>
                    <div>聊天发言</div>
                </a></li>
				{if condition="config('web_web_id') eq 1"}
				<li><a href="{:url('pc/admin',['act'=>'set','s'=>'task'])}" class="t-v" data-pjax>
                    <div><i class="icon icon-form"></i></div>
                    <div>任务运行</div>
                </a></li>
				<li><a href="{:url('pc/admin',['act'=>'set','s'=>'cron'])}" class="t-v" data-pjax>
                    <div><i class="icon icon-form"></i></div>
                    <div>任务监控</div>
                </a></li>
				{/if}
				<li><a href="{:url('pc/admin',['act'=>'set','s'=>'plugins'])}" class="t-v" data-pjax>
                    <div><i class="icon icon-form"></i></div>
                    <div>网站插件</div>
                </a></li>
				{if condition="config('web_web_id') eq 1"}
				<li><a href="{:url('pc/admin',['act'=>'set','s'=>'server'])}" class="t-v" data-pjax>
                    <div><i class="icon icon-form"></i></div>
                    <div>服务器设置</div>
                </a></li>
				{/if}
            </ul>
        </div>
<div class="c-content bl">
            <div class="col-6 fl br" style="min-height:420px;">
                <div class="g-title t-v pl4 bb">
                    <div class="col-12 h t-v bold">奖励开关</div>
                </div>
				<div class="p5 o-h">
        <div class="pt1 pb3 in-text">
            <dt class="bold bb pr2 lan">注册赠送余额</dt>
            <dd><select class="form w h8 bb" name="reg_free_rmb" default="{:config('sys_reg_free_rmb')}">
                <option value="0">关闭</option>
                <option value="1" {if condition="config('sys_reg_free_rmb') eq 1" }selected {/if}>开启</option>
            </select></dd>
        </div>
		<div class="pt1 pb3 in-text">
            <dt class="bold bb pr2 lan">注册赠送VIP</dt>
            <dd><select class="form w h8 bb" name="reg_free_vip" default="{:config('sys_reg_free_vip')}">
                <option value="0">关闭</option>
                <option value="1" {if condition="config('sys_reg_free_vip') eq 1" }selected {/if}>开启</option>
            </select></dd>
        </div>
		<div class="pt1 pb3 in-text">
            <dt class="bold bb pr2 lan">注册赠送配额</dt>
            <dd><select class="form w h8 bb" name="reg_free_peie" default="{:config('sys_reg_free_peie')}">
                <option value="0">关闭</option>
                <option value="1" {if condition="config('sys_reg_free_peie') eq 1" }selected {/if}>开启</option>
            </select></dd>
        </div>
		</div>
            </div>
            <div class="col-6 fl bl" style="margin-left:-1px;">
                <div class="g-title t-v pl4 bb">
                    <div class="col-12 h t-v bold">奖励配置</div>
                </div>
				<div class="p5 o-h">
				<div class="pt1 pb3 in-text">
				<dt class="bold bb pr2 lan">注册赠送配额(个)</dt>
				<dd><input type="text" class="form w h8 bb" name="reg_free_peie_num" value="{:config('sys_reg_free_peie_num')}" placeholder="填写注册赠送的配额"></dd>
				</div>
				<div class="pt1 pb3 in-text">
				<dt class="bold bb pr2 lan">注册赠送VIP(天)</dt>
				<dd><input type="text" class="form w h8 bb" name="reg_free_vip_day" value="{:config('sys_reg_free_vip_day')}" placeholder="填写注册赠送的VIP天数"></dd>
				</div>
				<div class="pt1 pb3 in-text">
				<dt class="bold bb pr2 lan">注册赠送余额(元)</dt>
				<dd><input type="text" class="form w h8 bb" name="reg_free_money_num" value="{:config('sys_reg_free_money_num')}" placeholder="填写注册赠送的余额"></dd>
				</div>
		</div>
            </div>
        </div>
</div>
</form>
<div class="c-pagination o-h t-v">
        <div class="c-sidebar"></div>
        <div class="c-content h11 o-h g-btn t-v bt bl">
            <div class="col-12 h t-v f3 hui pl5 pr5 t-c">
			<button class="btn btn-qing btn-md w22 rx1" @click="saveConfig()">保 存 设 置</button></div>
        </div>
    </div>
</div>

    </div>
   {/block}
   {block name='foot'}
		<script>
        new Vue({
            el: '#vue-page',
            methods: {
                saveConfig: function () {
                    app.ajax("{:url('admin_ajax/config')}", $("#form-config").serialize(), function (data) {
                        if (data.code === 0) {
                            x.msg(data.message)
                        } else {
                            x.msg(data.message)
                        }
                    })
                }
            }
        });
    </script>
    {/block}